﻿using Kz.Telegram.Bot.Infrastructure.Extensions;
using Microsoft.AspNetCore.Mvc;

namespace Kz.Telegram.Bot.Infrastructure.Attributes
{
    /// <summary>
    /// 简写响应缓存特性
    /// </summary>
    public class QuickCacheAttribute : ResponseCacheAttribute
    {
        public QuickCacheAttribute(int expire = 10, string keys = "")
        {
            Duration = expire;
            Location = ResponseCacheLocation.Client;
            if (!keys.IsNullOrEmpty())
            {
                VaryByQueryKeys = keys.Split(',');
            }
        }
    }
}